package gfx.tiles;

import java.awt.image.BufferedImage;

import core.Main;


/**
 * 
 * Loads a tileset and cuts them into a 2d array.
 * 
 * @author lueko.voss
 *
 */
public class Spritesheet {

    public BufferedImage[][] images;
    public int tileWidth, tileHeight;
    
    public static final Spritesheet sheet = new Spritesheet("/gfx/Tiles.png", 32, 32);
    public static final Spritesheet tileset = new Spritesheet("/gfx/tileset.png", 32, 32);
    
    /**
     * @param path Path of the tileset.
     * @param tileWidth Width of a single tile in pixels.
     * @param tileHeight Height of a single tile in pixels.
     */
    public Spritesheet(String path, int tileWidth, int tileHeight) {
        images = Main.imageLoader.splitImageMap(Main.imageLoader.load(path), tileWidth, tileHeight);
        this.tileWidth = tileWidth;
        this.tileHeight = tileHeight;
    }
    
}
